home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - Pascal
/
PAS025.dsk
/
ADMERG.TEXT.txt
< prev
next >
Wrap
Text File
|
2012-02-16
|
1KB
|
57 lines
(*$I-*)
PROGRAM ADMERG;
(* This program is short and sweet and not very robust. It is that
way to make it easy to type in. Now you know the record size of
ATTACH.DATA files, you are welcome to make it more robust yourself. *)
TYPE
DEVREC=ARRAY[0..8] OF INTEGER;
VAR
IDNAME,ODNAME:STRING;
CH:CHAR;
INDATA,OUTDATA:FILE OF DEVREC;
(* Any error aborts the program *)
PROCEDURE ERROR(ST:STRING);
BEGIN
WRITELN('ERROR =>',ST);
WRITE('RETURN to exit ADMERG:');
READLN;
EXIT(ADMERG)
END;
BEGIN
WRITE('Name of Data file you will create:');
READLN(ODNAME);
REWRITE(OUTDATA,ODNAME);
IF IORESULT<>0 THEN
ERROR('opening Output file');
CH:='Y';
WHILE (CH='Y') OR (CH='y') DO
BEGIN
WRITE('Name of Input file:');
READLN(IDNAME);
RESET(INDATA,IDNAME);
IF IORESULT<>0 THEN
ERROR('opening Input file');
WHILE NOT EOF(INDATA) DO
BEGIN
OUTDATA^:=INDATA^;
PUT(OUTDATA);
GET(INDATA)
END;
CLOSE(INDATA);
WRITE('Another Input file? Y)es, N)o :');
READLN(CH)
END;
CLOSE(OUTDATA,LOCK)
END.